<template>
  <div class="bottom" :style="`background-color:${dark ? 'black' : '#eee'}`">
    <!-- 动态类名 -->
    <!-- <div class="bottom" :class="{ light: !dark, dark: dark }"> -->
    <div class="content">
      <div class="left">
        <span>京ICP备2021000000号</span>
        <span>电话挂号热线：400-000-0000</span>
      </div>
      <div class="right">
        <span>联系我们</span>
        <span>合作伙伴</span>
        <span>用户协议</span>
        <span>隐私协议</span>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts" name="HospitalBottom">
// import { onMounted, watch } from 'vue'
import useThemeStore from '@/store/modules/theme'
import { storeToRefs } from 'pinia'
// 从仓库中获取控制是否为深色模式的属性
const { dark } = storeToRefs(useThemeStore())
// 当主题色切换时动态控制底部背景色 深色/亮色
/* watch(
  () => dark.value,
  (val) => {
    let bottom = document.querySelector('.bottom') as HTMLElement
    bottom.style.backgroundColor = val ? 'black' : '#eee'
  },
)
// 组件挂载时先根据dark属性初始化底部背景色
onMounted(() => {
  let bottom = document.querySelector('.bottom') as HTMLElement
  bottom.style.backgroundColor = dark.value ? 'black' : '#eee'
}) */
</script>

<style scoped lang="scss">
.bottom {
  width: 100%;
  height: 30px;
  background-color: #eee;
  z-index: -100;
  /* &.light {
    background-color: pink;
  }
  &.dark {
    background-color: black;
  } */
  .content {
    width: 1200px;
    height: 100%;
    margin: 0 auto; // 居中
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    font-size: 12px;
    color: $base-color;
    .left {
      span {
        margin-right: 15px;
      }
    }
    .right {
      span {
        margin-right: 10px;
      }
    }
  }
}
</style>
